﻿using System;
using HelloWorld.Repositories;
using HelloWorld.ViewModels.Home;
using Phoenix;
using Phoenix.ActionResults;

namespace HelloWorld.Controllers
{
    public class MainController : Controller
    {
        readonly IMenuRepository menuRepository;

        public MainController(IMenuRepository menuRepository)
        {
            this.menuRepository = menuRepository;
        }

        public PageActionResult Partial()
        {
            return Page();
        }

        public PageActionResult Menu()
        {
            return Page(new MenuViewModel(menuRepository.GetItems()));
        }

        public PageActionResult Menu(MenuItem item)
        {
            return Page(new MenuViewModel(menuRepository.GetItems(item)));
        }

        public ActionResult Home(MenuItem success)
        {
            return Page(new HomeViewModel());
        }

        public ActionResult PromptClose()
        {
            return Page(new PromptCloseViewModel());
        }
    }
}